package cn.cttic.base.api.domain.bo;

import cn.cttic.base.api.domain.BaseUser;
import cn.cttic.common.mybatis.core.domain.BaseEntity;
import cn.cttic.common.core.validate.AddGroup;
import cn.cttic.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

import java.time.LocalDate;
import java.util.Date;

/**
 * 账户信息业务对象 base_user
 *
 * @author Times.Studio
 * @date 2024-09-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BaseUser.class, reverseConvertGenerate = false)
public class BaseUserBo extends BaseEntity {

    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { EditGroup.class })
    private String id;

    /**
     * 用户类型
     */
    @NotBlank(message = "用户类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String userType;

    /**
     * 登录名
     */
    @NotBlank(message = "登录名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String userName;

    /**
     * 真实姓名
     */
    @NotBlank(message = "真实姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String realName;

    /**
     * 昵称
     */
    @NotBlank(message = "昵称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String nickName;

    /**
     * 身份证号码
     */
    @NotBlank(message = "身份证号码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String idCardNo;

    /**
     * email
     */
    @NotBlank(message = "email不能为空", groups = { AddGroup.class, EditGroup.class })
    private String email;

    /**
     * 联系电话
     */
    @NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
    private String phone;

    /**
     * 性别
     */
    @NotNull(message = "性别不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer gender;

    /**
     * 生日
     */
    @NotNull(message = "生日不能为空", groups = { AddGroup.class, EditGroup.class })
    private LocalDate birthday;

    /**
     * 密钥
     */
    @NotBlank(message = "密钥不能为空", groups = { AddGroup.class, EditGroup.class })
    private String salt;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String password;

    /**
     * 账户类型
     */
    @NotNull(message = "账户类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer type;

    /**
     * 用户状态
     */
    @NotNull(message = "用户状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer status;

    /**
     * 头像
     */
    @NotBlank(message = "头像不能为空", groups = { AddGroup.class, EditGroup.class })
    private String avatar;

    /**
     * 上级用户
     */
    @NotBlank(message = "上级用户不能为空", groups = { AddGroup.class, EditGroup.class })
    private String pid;

    /**
     * 是否有子节点
     */
    @NotNull(message = "是否有子节点不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer hasChild;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer sort;

    /**
     * 人员信息
     */
    @NotBlank(message = "人员信息不能为空", groups = { AddGroup.class, EditGroup.class })
    private String personId;

    /**
     * 所属单位
     */
    @NotBlank(message = "所属单位不能为空", groups = { AddGroup.class, EditGroup.class })
    private String companyId;

    /**
     * 是否首次登录
     */
    @NotNull(message = "是否首次登录不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer firstLogin;

    /**
     * 是否初始密码
     */
    @NotNull(message = "是否初始密码不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer initialPassword;


}
